package threadPool.threadExecutePool;

import java.util.concurrent.BlockingQueue;

/**
 * Description
 *
 * @ClassName threadPool
 * @Copyright 炫彩互动
 * @Author yanglh
 * @Create Date  2016/6/1
 * @Modified by none
 * @Modified Date
 */

public class Thread2 extends Thread{
    BlockingQueue<Integer> blockingQueue;

    public Thread2() {}

    public Thread2(BlockingQueue blockingQueue) {
        this.blockingQueue = blockingQueue;
    }

    @Override
    public void run() {
         while (true){
             try {
                 System.out.println("消费者:" + blockingQueue.take());
                 Thread.sleep(5000);
             } catch (InterruptedException e) {
                 e.printStackTrace();
             }
         }
    }
}
